Repository navigation
[1406] perf: 延迟加载完整 CLI 加速 gf pi --help - #27
Merged
Merged
Conversation
cli.scm import 了 (liii raw-string) 但从未使用其语法;help.scm 的 PI_HELP_TEXT 用 &- raw-string 块书写。raw-string 的 reader 扩展 在 import 时会被加载,带来不必要的启动开销。 - cli.scm: 删除无用的 (liii raw-string) import - help.scm: PI_HELP_TEXT 改用普通 string-append 字符串,移除 raw-string import 效果: gf pi --help 从 ~0.8s (波动 0.59-1.01s) 降至 ~0.52s (稳定), 约 35% 提速,输出逐字一致,tui/cli 全部 19 个测试通过。
da-liii
force-pushed
the
da/1406/help_perf
branch
from
November 24, 2026 17:07
8bb3d37 to
2e0abb1
Compare
# Conflicts: # app/liii/pi/app/cli.scm # app/liii/pi/app/cli/main.scm # app/tests/liii/pi/app/cli/main-test.scm # app/tests/liii/pi/app/main-test.scm # tui/tests/liii/pi/tui/cli/main-test.scm # tui/tests/liii/pi/tui/cli/main/main-test.scm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改动
(liii pi tui cli)改为轻量入口,帮助路径仅加载基础模块与帮助文本。(liii pi tui cli main),非帮助命令按需加载。gf pi -h/--help不再加载 TUI、模型、配置、会话和扩展,也不读取 stdin。auth --help)的行为不变。验证
gf test tui/tests/liii/pi/tui/cli/:19/19 通过。gf test tui/tests/liii/pi/tui/run-pi-test.scm:通过。gf fmt --check tui/liii/pi/tui/cli.scm tui/liii/pi/tui/cli/main.scm:通过。